# coding:utf-8
'''
Created on 2015年6月25日

@author: Emrys
'''
import logging

logger = logging.getLogger("spam")
logger.setLevel(logging.DEBUG)

fh = logging.FileHandler(r'.\spam.log')
fh.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setLevel(logging.ERROR)

formatter = logging.Formatter('%(asctime)s - %(name)s\
                                %(name)s - %(levelname)s - %(message)s')

fh.setFormatter(formatter)
ch.setFormatter(formatter)

logger.addHandler(fh)
logger.addHandler(ch)

logger.info("The info output")
logger.error("The ERROR output")
